package com.neutech.neurfin.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neutech.neurfin.service.FinService;
import com.neutech.neurfin.mapper.ConstantMapper;
import com.neutech.neurfin.mapper.FinMapper;
import com.neutech.po.Conts;
import com.neutech.po.Fin;

@Service
public class FinServiceImpl implements FinService {

	@Autowired
	private FinMapper finMapper;
	
	@Autowired
	private ConstantMapper constantMapper;

	@Override
	public Fin findFin(int id) throws Exception {
		// TODO Auto-generated method stub
		return finMapper.findFin(id);
	}

	@Override
	public Fin deleteFin(int id) throws Exception {
		// TODO Auto-generated method stub
		finMapper.deleteFin(id);
		return new Fin();
	}

	@Override
	public Fin updateFin(Fin fin) throws Exception {
		// TODO Auto-generated method stub
		finMapper.updateFin(fin);
		return new Fin();
	}

	@Override
	public Fin insertFin(Fin fin) throws Exception {
		// TODO Auto-generated method stub
		finMapper.insertFin(fin);
		return new Fin();
	}
	
	@Override
	public List<Conts> getConstantAll() throws Exception {
		// TODO Auto-generated method stub
		List<Conts> constantList = constantMapper.getConstantAll();
		return constantList;
	}
	
	@Override
	public int addConts(Conts conts) throws Exception {
		// TODO Auto-generated method stub
		int num = constantMapper.addConts(conts);
		return num;
	}
}
